﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace IQReportes.Utils
{
    /// <summary>
    /// Encriptación de la clave del usuario
    /// </summary>
    public static class Crypto
    {
        /// <summary>
        /// crear un hash a partir de la clave
        /// </summary>
        /// <param name="value">clave</param>
        /// <returns>clave encriptada</returns>
        public static string Hash(string value)
        {
            return Convert.ToBase64String(
                System.Security.Cryptography.SHA256.Create()
                .ComputeHash(Encoding.UTF8.GetBytes(value)));
        }
    }
}